<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>此页面用于测试vue2中的filter</title>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
<!--说明：此代码成功。放弃了过滤器，使用methods中的format -->
		<div id="app">
			
			<div v-text="formatMsg(message)">
				
			</div>
		</div>

		<script type="text/javascript">
			window.onload = function() {
				//在这里面写Vue.js代码
				new Vue({
					el: '#app',
					methods: {
						formatMsg: function(value) {

							value = value.replace("He", "OK!");
							return value;

						}
					},
					data: {
						message: 'Hello Vue.js!'
					}
				})
				//----------------
			}
			
			
			
		</script>
	</body>

</html>